package com.mtzqc.common.rv.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.LayoutRes
import com.chad.library.adapter.base.BaseQuickAdapter
import com.mtzqc.common.rv.holder.XViewHolder

abstract class XQuickAdapter<T>(@LayoutRes val layoutRes: Int) :
    RootQuickAdapter<View, T, XViewHolder>() {
    override fun createXViewHolder(v: View): XViewHolder {
        return XViewHolder(v)
    }

    override fun createBaseViewHolder(context: Context, parent: ViewGroup, viewType: Int): View {
        return LayoutInflater.from(parent.context).inflate(layoutRes, parent, false)
    }

}